import 'package:backend.analytics/domain/entities/amplitude/amplitude_event_type.dart';
import 'package:backend.analytics/domain/entities/amplitude_api/amplitude_api_event_type.dart';

abstract class CreateAmplitudeEventTypeFromApiOne {
  AmplitudeEventType call({
    required AmplitudeApiEventType apiEventType,
  });
}

class CreateAmplitudeEventTypeFromApiOneImpl implements CreateAmplitudeEventTypeFromApiOne {
  const CreateAmplitudeEventTypeFromApiOneImpl();

  @override
  AmplitudeEventType call({
    required AmplitudeApiEventType apiEventType,
  }) {
    switch (apiEventType) {
      case AmplitudeApiEventType.trialStarted:
        return AmplitudeEventType.trialStarted;
      case AmplitudeApiEventType.subscriptionPurchased:
        return AmplitudeEventType.subscriptionPurchased;
      case AmplitudeApiEventType.subscriptionRenewed:
        return AmplitudeEventType.subscriptionRenewed;
      case AmplitudeApiEventType.oneTimePurchaseItemPurchased:
        return AmplitudeEventType.oneTimePurchaseItemPurchased;
      case AmplitudeApiEventType.transactionRevoked:
        return AmplitudeEventType.transactionRevoked;
    }
  }
}
